package com.example.yupao.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.yupao.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.yupao.model.request.SearchUsersByTagsRequest;
import com.example.yupao.model.request.UserSearchRequest;
import com.example.yupao.model.request.UserUpdateRequest;
import com.example.yupao.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 86138
* @description 针对表【user】的数据库操作Service
* @createDate 2024-08-26 14:35:32
*/
public interface UserService extends IService<User> {

    /**
     * 根据标签id查询用户
     * @param searchUsersByTagsRequest
     * @return
     */
    List<User> searchUsersByTags(SearchUsersByTagsRequest searchUsersByTagsRequest);


    /**
     * 用户注册
     * @param account
     * @param password
     * @param checkPassword
     * @return
     */
    long register(String account,String password,String checkPassword);

    /**
     * 用户登录
     * @param account
     * @param password
     * @return
     */
    User login(String account, String password, HttpServletRequest request);

    /**
     * 根据用户名搜索
     * @param userSearchRequest
     * @return
     */
    List<User> search(UserSearchRequest userSearchRequest);

    /**
     * 获取当前的用户信息
     * @param request
     * @return
     */
    User getCurrentUser(HttpServletRequest request);

    /**
     * 用户退出
     * @param request
     */
    void logout(HttpServletRequest request);

    boolean updateByCondition(UserUpdateRequest userUpdateRequest,HttpServletRequest request);

    /**
     * 推荐用户 若登录->推荐算法  未登录->查询前5条
     * @param request
     * @return
     */
    Page<User> recommendUsers(UserSearchRequest userSearchRequest, HttpServletRequest request);

    /**
     * 匹配team
     * @param num
     * @param request
     * @return
     */
    List<UserVO> matchTeam(Long num, HttpServletRequest request);
}
